<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div class="body">
        <h2>断点demo</h2>
        <input type="text" class="input1"> + 
        <input type="text" class="input2">
        <button class="btn"> = </button>
        <span id="result">  </span>
    </div>
</body>
<script>
    let input1 = document.querySelector('.input1');
    let input2 = document.querySelector('.input2');
    let btn = document.querySelector('.btn');
    let result = document.querySelector('#result');
    btn.addEventListener('click',function(){
        let results = fun(input1.value, input2.value);
        result.innerHTML = results
    })
    function fun(n1, n2){
        console.log(n1, n2);
        return n1 + n2;
    }
</script>
</html>